package objects

import (
	"ones-objects/lib/object"
	"ones-objects/objects-api/heartbeat"
	"fmt"
)

func putStream(name string) (*object.PutStream, error) {
	server := heartbeat.ChooseRandomDataServer()
	if len(server) <= 0 {
		return nil, fmt.Errorf("no dataserver")
	}
	return object.NewPutStream(server, name)
}
